<?php
namespace App\Http\Controllers\Client\ClientUser;
use App\Http\Controllers\BaseController;
use App\Http\Requests\User\UserUpdateRequest;
use App\Http\Resources\ClientUser\ClientUserInfoResource;
use App\Services\ClientUser\ClientUserService;
use Illuminate\Http\Request;
class ClientUserController extends BaseController
{
    /** @var ClientUserService $service */
    private $service;
    public function __construct(ClientUserService $service)
    {
        $this->service = $service;
    }

    public function info(Request $request): ClientUserInfoResource
    {
        return new ClientUserInfoResource($this->service->info());
    }

    public function update(UserUpdateRequest $request): array
    {
        return $this->service->setParams($request->all())->update();
    }
}
